import request from '@/utils/request'

export function createClass(data) {
  return request({
    url: '/admin/user/course/add',
    method: 'post',
    data
  })
}

export function getClassList(params) {
  return request({
    url: '/admin/user/course/list',
    method: 'get',
    params
  })
}

export function getClassInfo(params) {
  return request({
    url: '/admin/user/course/info',
    method: 'get',
    params
  })
}

export function updateClass(data) {
  return request({
    url: '/admin/user/course/update',
    method: 'post',
    data
  })
}

export function delClass(data) {
  return request({
    url: '/admin/user/course/del',
    method: 'post',
    data
  })
}
export function sortClass(data) {
  return request({
    url: '/admin/user/course/changeSort',
    method: 'post',
    data
  })
}
//章节,子课题相关
export function createChapter(data) {
  return request({
    url: '/admin/user/chapter/add',
    method: 'post',
    data
  })
}

export function getChapterList(params) {
  return request({
    url: '/admin/user/chapter/list',
    method: 'get',
    params
  })
}

export function delChapter(data) {
  return request({
    url: '/admin/user/chapter/del',
    method: 'post',
    data
  })
}

export function getChapterInfo(params) {
  return request({
    url: '/admin/user/chapter/info',
    method: 'get',
    params
  })
}

export function updateChapter(data) {
  return request({
    url: '/admin/user/chapter/update',
    method: 'post',
    data
  })
}

export function ishowChapter(data) {
  return request({
    url: '/admin/user/chapter/showStatus',
    method: 'post',
    data
  })
}

export function isOpenChapter(data) {
  return request({
    url: '/admin/user/chapter/openStatus',
    method: 'post',
    data
  })
}

export function teacherForChapter() {
  return request({
    url: '/admin/user/teacher/list',
    method: 'get'
  })
}

export function setTeachingTeacher(data) {
  return request({
    url: '/admin/user/chapter/setTeacher',
    method: 'post',
    data
  })
}
//报名列表
export function getbaomingList(params) {
  return request({
    url: '/admin/user/chapter/signList',
    method: 'get',
    params
  })
}

export function cancelBaoming(data) {
  return request({
    url: '/admin/user/chapter/cancelSign',
    method: 'post',
    data
  })
}
